//package cn.cttic.app.api.controller;
//
//import cn.dev33.satoken.annotation.SaCheckPermission;
//import cn.cttic.common.core.domain.R;
//import cn.cttic.common.core.validate.AddGroup;
//import cn.cttic.common.core.validate.EditGroup;
//import cn.cttic.common.core.web.controller.BaseController;
//import cn.cttic.common.excel.utils.ExcelUtil;
//import cn.cttic.common.log.annotation.Log;
//import cn.cttic.common.log.enums.BusinessType;
//import cn.cttic.common.mybatis.core.page.PageQuery;
//import lombok.RequiredArgsConstructor;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//import cn.cttic.app.api.domain.vo.AppUserPrivilegeVo;
//import cn.cttic.app.api.domain.bo.AppUserPrivilegeBo;
//import cn.cttic.app.service.IAppUserPrivilegeService;
//import cn.cttic.common.mybatis.core.page.TableDataInfo;
//
//import java.util.List;
//import java.util.Arrays;
//import jakarta.validation.constraints.NotEmpty;
//import jakarta.validation.constraints.NotNull;
//import javax.servlet.http.HttpServletResponse;
//
///**
// * 会员权益控制器
// * 前端访问路由地址为:/system/userPrivilege
// *
// * @author Times.Studio
// * @date 2024-02-27
// */
//@Validated
//@RequiredArgsConstructor
//@RestController
//@RequestMapping("/userPrivilege")
//public class BackendAppUserPrivilegeController extends BaseController {
//
//    private final IAppUserPrivilegeService iAppUserPrivilegeService;
//
//    /**
//     * 查询会员权益列表
//     */
//    @SaCheckPermission("system:userPrivilege:list")
//    @GetMapping("/list")
//    public TableDataInfo<AppUserPrivilegeVo> list(AppUserPrivilegeBo bo, PageQuery pageQuery) {
//        return iAppUserPrivilegeService.queryPageList(bo, pageQuery);
//    }
//
//    /**
//     * 导出会员权益列表
//     */
//    @SaCheckPermission("system:userPrivilege:export")
//    @Log(title = "会员权益", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(AppUserPrivilegeBo bo, HttpServletResponse response) {
//        List<AppUserPrivilegeVo> list = iAppUserPrivilegeService.queryList(bo);
//        ExcelUtil.exportExcel(list, "会员权益", AppUserPrivilegeVo.class, response);
//    }
//
//    /**
//     * 获取会员权益详细信息
//     *
//     * @param id 主键
//     */
//    @SaCheckPermission("system:userPrivilege:query")
//    @GetMapping("/{id}")
//    public R<AppUserPrivilegeVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable String id) {
//        return R.ok(iAppUserPrivilegeService.queryById(id));
//    }
//
//    /**
//     * 新增会员权益
//     */
//    @SaCheckPermission("system:userPrivilege:add")
//    @Log(title = "会员权益", businessType = BusinessType.INSERT)
//    @PostMapping()
//    public R<Void> add(@Validated(AddGroup.class) @RequestBody AppUserPrivilegeBo bo) {
//        return toAjax(iAppUserPrivilegeService.insertByBo(bo));
//    }
//
//    /**
//     * 修改会员权益
//     */
//    @SaCheckPermission("system:userPrivilege:edit")
//    @Log(title = "会员权益", businessType = BusinessType.UPDATE)
//    @PutMapping()
//    public R<Void> edit(@Validated(EditGroup.class) @RequestBody AppUserPrivilegeBo bo) {
//        return toAjax(iAppUserPrivilegeService.updateByBo(bo));
//    }
//
//    /**
//     * 删除会员权益
//     *
//     * @param ids 主键串
//     */
//    @SaCheckPermission("system:userPrivilege:remove")
//    @Log(title = "会员权益", businessType = BusinessType.DELETE)
//    @DeleteMapping("/{ids}")
//    public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable String[] ids) {
//        return toAjax(iAppUserPrivilegeService.deleteWithValidByIds(Arrays.asList(ids), true));
//    }
//}
